#include <iostream>
using namespace std;


int GetNumTotal(int n, int num){
    int total = 0;
    while(n){
        if (n % 10 == num){
            total++;
        }

        n /= 10;
    }

    return total;
}



/**
 * https://www.luogu.com.cn/problem/P1179
 */
int main(){
    int begin,end;
    cin >> begin >> end;

    int all = 0;
    for(int i=begin; i<= end; i++){
        all += GetNumTotal(i, 2);
    }

    cout << all;

    return 0;
}